package com.thread.oop;

class MyThread1 extends Thread{
	public volatile static int count;
	private static void addCount(){
		for(int i=0; i<100; i++){
			count++;
		}
		String name = Thread.currentThread().getName();
		System.out.println(name + "  count=="+count);
	}
	public void run(){
		addCount();
	}
}
public class ThreadVolatileTest4 {

	public static void main(String[] args) {
		MyThread1[] mythreadArray = new MyThread1[100];
		for(int i=0;i<100; i++){
			mythreadArray[i]=new MyThread1();
		}
		for(int i=0;i <100; i++){
			mythreadArray[i].start();
		}
	}

}
